using System;
using System.Collections.Generic;
using System.Text;
using WindowsLive.Writer.Api;
using System.Windows.Forms;


namespace XFNLink
{
    [WriterPluginAttribute
       ("557BC8EC-BC09-4b3a-91F3-B0AFF8554042",
        "XFN Link",
        ImagePath = "Images.XFN.png",
        PublisherUrl = "http://nayyeri.net",
        Description = "Inserts XFN Links in Blog Posts")]

    [InsertableContentSourceAttribute("XFN Link")]
    public class Plugin : ContentSource
    {
        public override DialogResult CreateContent(IWin32Window dialogOwner,
            ref string newContent)
        {
            using (InsertForm insertForm = new InsertForm())
            {
                DialogResult result = insertForm.ShowDialog();

                if (result == DialogResult.OK)
                {
                    newContent = insertForm.GetLink();
                }
                return result;
            }
        }
    }
}
